/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controllers;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import webserviceclient.Reports;
import webserviceclient.Reports_Service;
import webserviceclient.Transaction;

/**
 *
 * @author julianDavidPG
 */
public class ServiceControl {
    private final String serviceLocation = "http://localhost:8080/Reports/Reports?WSDL";
    private URL url = null;

    public ServiceControl() {
        try {
            url = new URL(serviceLocation);
        } catch (MalformedURLException malformedURLException) {
            System.out.println("Direccion inválida");
        }
    }
    
    public List<Transaction> getTransactions(String initDate, String finDate, long sucursalID, long almacen, long franquiciaID, String reportType, double amount){
        Reports_Service rs = new Reports_Service(url);
        Reports r = rs.getReportsPort();
        return r.getTransactions(initDate, finDate, sucursalID, almacen, franquiciaID, reportType, amount);
    }
    
    public List<String> getReportTypes(){
        Reports_Service rs = new Reports_Service(url);
        Reports r = rs.getReportsPort();
        return r.getReportTypes();
    }
    
}

